var blackbe_url_qq = "http://api.blackbe.xyz/api/qqcheck?v2=true&qq="
var blackbe_url_id = "http://api.blackbe.xyz/api/check?v2=true&id="

LB.EXTENSION.blackbe = function(way,target,type){
    switch(way){
        case "qq":
            var url = blackbe_url_qq+target
        break;

        case "xboxid":
            var url = blackbe_url_id+target
        break;
    }

    LB.HELPER.HTTPGET(url,(res)=>{
        switch(res.error){
            default:
            break;
    
            case 2001: //已上报违规，审核中
                var code = res.error;
                var name = res.data.name;
                var qqid = res.data.qq;
                var result = res.message;
                var details = "\n“"+res.data.info+"”";
                var operation = false;
                var from_server = res.data.server;
                var action = "拒绝加群";
            break;
    
            case 2002: //违规
                var code = res.error;
                var name = res.data.name;
                var qqid = res.data.qq;
                var result = res.message;
                var details = "\n“"+res.data.info+"”";
                var operation = false;
                var from_server = res.data.server;
                var action = "拒绝加群";
            break;
    
            case 2003: //无违规
                var code = res.error;
                var name = "无";
                var qqid = "无";
                var result = res.message;
                var details = "无";
                var operation = true;
                var from_server = "无";
                var action = "允许加群";
            break;
        }
        switch(type){
            case 0: //自助查询
                LB.bot.toMgmtGroup(LB.HELPER.MSG.getBlackbeOption("self_check_nofication",name,qqid,result,details,from_server))
            break;
    
            case 1: //加群时查询
                return{
                    code : code,
                    name : name,
                    qqid : qqid,
                    result : result,
                    details : details,
                    operation : operation,
                    from_server : from_server,
                    action : action
                }
        }
    })
}
/*
  success: true,
  error: 2002,
  message: '存在违规行为',
  version: 'v2',
  data: {
    name: 'ActingBinkie341',
    xbox_id: null,
    level: 2,
    info: '作弊、盗窃，被管理员抓住还嘴硬(注：我们服务器没设置白名单系统，没有获取到此人的QQ号码)',
    qq: 0,
    trial: 1,
    server: 'MaxCraft'
  }
}

{
  success: true,
  error: 2002,
  message: '存在违规行为',
  version: 'v2',
  data: {
    name: 'WryStorm976704',
    xbox_id: null,
    level: 3,
    info: '该玩家通过放置蜂箱，并修改其nbt，达到使用命令方块的效果。并反复杀死所有生物，破坏服内建筑',
    qq: 2705180138,
    trial: 1,
    server: 'SPU'
  }
}

{
    success: true,
    error: 2003,
    message: '无违规行为',
    version: 'v2'
}

 */